import request from '@/utils/request'

// 获取轮播图
export const getPageCarsouel = function (data) {
    return request({
        url: '/carousel/get',
        method: 'post',
        data
      })
}

// 获取轮播图个数
export const getCount = function () {
  return request({
      url: '/carousel/count',
      method: 'get',
    })
}

// 修改轮播图的状态
export const changeStatus = function (id,status) {
    return request({
        url: '/carousel/changeStatus'+'/'+id+'/'+status,
        method: 'get',
      })
}

//修改轮播图
export const update = function (data) {
    return request({
        url: "/carousel/update",
        method: 'post',
        data
      })
}

// 添加轮播图
export const addCarousel= function (data) {
    return request({
        headers: { "Content-Type": "multipart/form-data"},
        url: "/carousel/add",
        method: 'post',
        data
      })
}

// 删除轮播图
export const delCarousel = function (id) {
  return request({
    url: "/carousel/del/" + id,
    method: 'get',
  })
}